{% extends "accounts/template.html" %}
{% load staticfiles %}

{% block title %}
    重置密码
{% endblock %}

{% block content %}

          {% if validlink %}
            <form class="form form-horizontal" action="" method="post">
              {% csrf_token %}
                <div class="row cl ">
                    <label class="form-label col-xs-3"></label>
                    <div class="formControls col-xs-8">
                       <h3 >重置用户{{ form.user.username }}的密码</h3>
                    </div>
                </div>
                <div class="row cl ">
                    <label class="form-label col-xs-3"></label>
                    <div class="formControls col-xs-8">
                        <input type="password" class="input-text size-L"
                               name="new_password1" maxlength="254"
                               required id="id_new_password1">
                    </div>
                </div>
                <div class="row cl ">
                    <label class="form-label col-xs-3"></label>
                    <div class="formControls col-xs-8">
                        <input type="password" class="input-text size-L"
                               name="new_password2" maxlength="254"
                               required id="id_new_password2">
                    </div>
                </div>
                <div class="row cl text-c">
                  <input type="submit" name="reset"
                         class="btn btn-success radius size-L" value="重置密码" />
                </div>
            </form>
          {% else %}
              <div class="row cl">
                  <label class="form-label col-xs-3"></label>
                <div class="formControls col-xs-8">
                    <h3>重置密码</h3>
                </div>
              </div>
                <div class="row cl">
                    <label class="form-label col-xs-3"></label>
                    <div class="formControls col-xs-8">
                         <p>你使用了一个无效的链接，请重试。</p>
                    </div>
                </div>
                <div class="row cl text-c">
                  <label class="form-label col-xs-3"></label>
                  <div class="formControls col-xs-8">
                    <a href="{% url 'password_reset' %}"
                       class="btn btn-secondary btn-block">
                      请求新的密码重置链接
                    </a>
                    </div>
                </div>
          {% endif %}
{% endblock %}